﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DocumentEdit.aspx.cs" Inherits="Gmis.Web.Manage.Affairs.DocumentEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <script type="text/javascript">
         function uploadifyComplete(event, queueId, fileObj, response, data) {             
             var obj = DWZ.jsonEval(response);
             document.getElementById("idImg").src = obj.msg;
             document.getElementById("txt_sPicture").value = obj.msg;
         }
    </script> 
</head>
<body>
    <div class="pageContent">
        <form method="post" action="Affairs/DocumentHandler.ashx" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
        <div class="pageFormContent" layoutH="56">

            <input type="hidden" name="txt_sId" value="<%=sId %>" />
            <input type="hidden" name="action" value="<%=action %>" />         
                <p>
                    <label>文档编号</label><input type="text" name="txt_sNumber" value="<%=model.sNumber %>" class="required" />
                </p>
                <p>
                    <label>文档名称</label><input type="text" name="txt_sName" value="<%=model.sName %>" class="required" />
                </p>
                
                <p>
                    <label>存档日期</label><input type="text" name="txt_dCreateDate" class="required date" yearstart="-80" yearend="5" value="<%= model.dCreateDate.ToString("yyyy-MM-dd") %>"/><a class="inputDateButton" href="javascript:;">选择</a>
                </p>

                <dl class="nowrap">             
                <div class="tabs">
                <div class="tabsHeader">
                    <div class="tabsHeaderContent">
                        <ul>
                        <li class="selected"><a href="#"><span>文字内容</span></a></li>
                        <li><a href="#"><span>图片内容</span></a></li>
                        </ul>
                    </div>
                </div>

                <div class="tabsContent" style="height:440px">
                    <div>
                      <textarea class="editor" name="txt_sContent" rows="27" cols="105" tools="simple" upimgurl="UploadFile.ashx?action=Document"
                        upimgext="jpg,jpeg,gif,png"><%=model.sContent %></textarea>
                    </div>
                    <div>
                         <input type="hidden" id="txt_sPicture" name="txt_sPicture" />                         
                         <span id="fileQueue" class="fileQueue"></span>
                         <input id="testFileInput" type="file" name="image" 
                               uploader="../Scripts/uploadify/scripts/uploadify.swf"
                               cancelImg="../Scripts/uploadify/cancel.png" 
                               script="UploadFile.ashx?action=document"                                
                               fileQueue="fileQueue"
                               onAllComplete="uploadifyComplete" 
                               fileExt="*.jpg;*.jpeg;*.gif;*.png;"
                               fileDesc="*.jpg;*.jpeg;*.gif;*.png;"/>
                         <img id="idImg" src="<%= Gmis.Public.CommonFunction.GetDocumentPath() + model.sPicture %>"/>
                    </div>
                </div>

                <div class="tabsFooter">
                <div class="tabsFooterContent"></div>
                </div>
              </div> 
           
               </dl>             
         </div>      
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent"><button type="submit">提交</button></div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent"><button type="button" class="close">关闭</button></div>
                    </div>
                </li>
            </ul>
        </div>
        </form>
    </div>
</body>
</html>
